import React from 'react'
import './index.css'

export default function index({ todoList, setTodoList }) {
  //计算已完成的个数
  const getCheckedNum = () => {
    return todoList.reduce((p, c) => c.done ? p + 1 : p, 0);
  }
  return (
    <div>
        <div className="todo-footer">
          <label>
            <input type="checkbox" />
          </label>
          <span>
            <span>已完成{getCheckedNum()}</span> / 全部{todoList.length}
          </span>
          <button className="btn btn-danger">清除已完成任务</button>
        </div>
    </div>
  )
}
